package com.Pounds.dao.Impl;

import com.Pounds.dao.PostDao;
import com.Pounds.mapper.PostMapper;
import com.Pounds.pojo.Post;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PostDaoImpl implements PostDao {
    // 暂且分配，后续需要改进为动态分配模式，即从控制类中获取需要响应的表
    private final String userDataBase = "UserData_1";

    @Autowired
    private PostMapper postMapper;

    @Override
    public List<Post>[] getPosts(String timestamp, String number) {
        return postMapper.getPosts(userDataBase, timestamp, number);
    }
}
